package com.cy.controller;

import com.cy.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
public class Usercontroller {

    @Autowired
    private MailService mailService;

    @RequestMapping("/sendEmail")
    @ResponseBody    //返回字符串       不加返回页面路径
    public String sendEmail(String email, HttpSession session){
        mailService.sendMimeMail(email,session);
        return "验证码发送成功";
    }
}
